package com.luntan.school.service;


import com.luntan.school.model.Admin;
import com.luntan.school.model.Category;
import com.luntan.school.util.TimeFormat;

import java.util.Date;

public class Posts {
    private int id;
    private String title;
    private String content;
    private String img;
    private Date pubDate;
    private int clickCount;
    private int likeNum;
    private int dislikeNum;
    private int categoryId;
    private Admin editor;
    private Integer commentNum;
    private Category category;
    private Boolean stick;
    public Integer getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public Date getPubDate() {
        return pubDate;
    }

    public void setPubDate(Date pubDate) {
        this.pubDate = pubDate;
    }

    public int getClickCount() {
        return clickCount;
    }

    public void setClickCount(int clickCount) {
        this.clickCount = clickCount;
    }

    public int getLikeNum() {
        return likeNum;
    }

    public void setLikeNum(int likeNum) {
        this.likeNum = likeNum;
    }

    public int getDislikeNum() {
        return dislikeNum;
    }

    public void setDislikeNum(int dislikeNum) {
        this.dislikeNum = dislikeNum;
    }

    public int getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(int categoryId) {
        this.categoryId = categoryId;
    }
    public Admin getEditor() {
        return editor;
    }

    public Boolean getStick() {
        return stick;
    }

    public void setStick(Boolean stick) {
        this.stick = stick;
    }

    public Integer getCommentNum() {
        return commentNum;
    }

    public void setCommentNum(Integer commentNum) {
        this.commentNum = commentNum;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public void setEditor(Admin editor) {
        this.editor = editor;
    }

    @Override
    public String toString() {
        return "Posts{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", img='" + img + '\'' +
                ", pubDate=" + pubDate +
                ", clickCount=" + clickCount +
                ", likeNum=" + likeNum +
                ", dislikeNum=" + dislikeNum +
                ", categoryId=" + categoryId +
                ", editor=" + editor +
                '}';
    }

    public String getPubDateInterval() {
        return TimeFormat.getInterval(pubDate);
    }
}